//
//  Common.swift
//  weibo
//
//  Created by 孙飞 on 15/12/12.
//  Copyright © 2015年 Sunfei. All rights reserved.
//

import UIKit

//首页 cell子控件之间间距
let MXSCellMargin: CGFloat = 10

let SCREENW = UIScreen.mainScreen().bounds.size.width
let SCREENH = UIScreen.mainScreen().bounds.size.height

///  - returns: 随机颜色
func RandomColor() -> UIColor {

    let red = CGFloat(arc4random() % 256) / 255.0
    let green = CGFloat(arc4random() % 256) / 255.0
    let blue = CGFloat(arc4random() % 256) / 255.0
    return UIColor(red: red, green: green, blue: blue, alpha: 1.0)

}





// 自定义的log
// 在 BuildSettting 中 搜索 other swift flags 添加一个 `-D DEBUG`

//         __FILE__
//__LINE__
//__FUNCTION__
func printLog<T>(
    message: T,
    file: String = __FILE__,
    line: Int = __LINE__,
    mthName: String = __FUNCTION__
    ) {
        #if DEBUG
            __LINE__
            print("\((file as NSString).lastPathComponent)[\(line)], \(mthName): \(message)")
        #endif
}